<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Cache-Control" content="no-siteapp">
<link rel="stylesheet" href="../../../static/layui/css/layui.css" media="all" />
<link rel="stylesheet" href="../../../static/css/public.css" media="all" />
</head>
<body class="childrenBody">
	<form class="layui-form" lay-filter="formTest" id="form" style="width: 80%;">
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">简历模版</label>
			<div class="layui-input-block">
				<select name="rstype" id="rstype" lay-verify="required">
					<option value="">请选择</option>
					<option value="1">51job</option>
					<option value="2">智联</option>
					<option value="3">自定义</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<label class="layui-form-label">上传文件</label>
			<div class="layui-input-block">
				<button type="button" class="layui-btn" id="upload">
					<i class="layui-icon">&#xe67c;</i>上传
				</button>
			</div>
		</div>
		<div class="layui-form-item layui-row layui-col-xs12">
			<div class="layui-input-block">
				<button type="button" class="layui-btn layui-btn-sm" lay-submit="" id="submit" lay-filter="submit">提交</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary close-btn">取消</button>
			</div>
		</div>
	</form>
	<script type="text/javascript" src="../../../static/js/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../../static/layui/layui.js"></script>
	<script type="text/javascript" src="../../../static/js/index.js"></script>
	<script type="text/javascript" src="../../../static/custom/js/common.js"></script>
	<script type="text/javascript">
		layui.use([ 'form', 'laydate', 'layer', 'upload' ], function() {
			var form = layui.form;
			var laydate = layui.laydate;
			var layer = parent.layer === undefined ? layui.layer : top.layer, $ = layui.jquery;
			var upload = layui.upload;
			var importExcelApi = "../../../advisory/customer/importExcel";
			
			var rf = function(response) {
				layer.msg(response.msg);
				layer.open({
					  title: '已存在手机号码'
					  ,content: response.data
					});   
				parent.layer.closeAll("iframe");
				// 刷新父页面
				parent.location.reload();
			}
			
			//执行实例
			var uploadInst = upload.render({
				elem : '#upload',
				acceptMime : "application/vnd.ms-excel",
				accept : 'file',
				auto: false,//选择文件后不自动上传
				url : importExcelApi,//上传接口
				bindAction: '#submit',
				//上传前的回调
				before: function () {
				  this.data = {
					rstype: $('#rstype').val()
				  }
				},
				//选择文件后的回调
				/* choose: function (obj) {
				  obj.preview(function (index, file, result) {
				    $('#upload').attr('src', result);
				  })
				}, */
				done : function(res) {
					//上传完毕回调
					baseCallBack(res, rf, rf);
				},
				error : function() {
				}
			});
		})
	</script>
</body>
</html>